Recommit rL245802: Cleanup fancy pointer rebinding in list using __rebind_pointer. Currently we need an #ifdef branch every time we use pointer traits to rebind a pointer because it is done differently in C++11 and C++03. This patch introduces the __rebind_pointer utility to clean this up. Also add a test that list and it's iterators can be instantiated with incomplete element types. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@245806 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/memory b/include/memory index 38ce433..9d214be 100644 --- a/include/memory +++ b/include/memory
@@ -932,6 +932,15 @@ {return _VSTD::addressof(__r);} }; +template <class _From, class _To> +struct __rebind_pointer { +#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES + typedef typename pointer_traits<_From>::template rebind<_To> type; +#else + typedef typename pointer_traits<_From>::template rebind<_To>::other type; +#endif +}; + // allocator_traits namespace __has_pointer_type_imp